<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    *{margin: 0;padding: 0;}
    /* #box{
        width: 300px;height: 300px;border: 1px black solid;position: relative;
    } */
    /* .box2{
        width: 100px;height: 100px;background: red;position: absolute;
        top: 50%;left: 50%;transform: translate(-50px,-50px);
    } */
    /* .box2{
        width: 100px;height: 100px;background: red;position: absolute;
        top: 50%;left: 50%;margin-top: -50px;margin-left: -50px;
    }  */
    /* .box2{
        width: 100px;height: 100px;background: red;position: absolute;
        top: 0;left: 0;bottom: 0;right: 0;margin: auto;
    }  */
    /* .box2{
        width: 100px;height: 100px;background: red;position: absolute;
        top: calc(50% - 50px);left: calc(50% - 50px);
    }  */

    /* #box{
        width: 300px;height: 300px;border: 1px black solid;
        text-align: center;font-size: 0;line-height: 300px;
    }
    .box2{
        background: red;width: 100px;height: 100px;
        display: inline-block;line-height: initial;vertical-align: middle;font-size: 16px;text-align: left;
    }  */

    /* #box{
        width: 300px;height: 300px;border: 1px black solid;
        display: table-cell;vertical-align: middle;text-align: center;
    }
    .box2{
        background: red;width: 100px;height: 100px;
        display: inline-block;
    }  */

    /* #box{
        width: 300px;height: 300px;border: 1px black solid;
        display: flex;justify-content: center;align-items: center;
    }
    .box2{
        background: red;width: 100px;height: 100px;
    }  */

    #box{
        width: 300px;height: 300px;border: 1px black solid;
        display: grid;align-items: center;justify-content: center;
    }
    .box2{
        background: red;width: 100px;height: 100px;
    } 

</style>
<body>
    <div id="box">
        <div class="box2">55</div>
    </div>
</body>
</html>